//
//  RecommendCollectionViewCell.m
//  DolphinMusic
//
//  Created by dllo on 15/3/22.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "RecommendCollectionViewCell.h"
#import "UIImageView+WebCache.h"


@implementation RecommendCollectionViewCell

- (void)dealloc
{
    [_imageView release];
    [_imageStr release];
    [_nextPageStr release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageView];
        [_imageView release];
        
        
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    self.imageView.frame = layoutAttributes.frame;
}

- (void)setImageStr:(NSString *)imageStr
{
    if (_imageStr != imageStr) {
        [_imageStr release];
        _imageStr = [imageStr retain];
    }
    self.imageView.frame = self.contentView.frame;
    
    
    NSURL *url = [NSURL URLWithString:[self.imageStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    
    [self.imageView setImageWithURL:url];
    
    
}



@end
